package com.abysscore.yachtdesign;

import java.io.Serializable;

public class TFreeVisibility implements Serializable {
	private TFreeShip FOwner;
	private boolean FShowControlNet;
	private boolean FShowInteriorEdges;        // Show the surface edges
	private boolean FShowStations;        // Show the calculated stations
	private boolean FShowButtocks;        // Show the calculated Buttocks
	private boolean FShowWaterlines;        // Show the calculated Waterlines
	private boolean FShowDiagonals;        // Show the calculated Diagonals
	private TFreeModelView FModelView; // Show half or entire ship
	private boolean FShowNormals;        // Show normals of selected surface patches
	private boolean FShowGrid;        // Show the grid of intersections in the plan,profile and bodyplan view
	private boolean FShowMarkers;
	private boolean FShowControlCurves;
	private boolean FShowCurvature;
	private boolean FShowHydrostaticData;
	private boolean FShowHydrostDisplacement;
	private boolean FShowHydrostLateralArea;
	private boolean FShowHydrostSectionalAreas;
	private boolean FShowHydrostMetacentricHeight;
	private boolean FShowHydrostLCF;
	private boolean FShowFlowlines;
	private double FCurvatureScale;     // Scalefactor used to increase or decrease the size of the curvature plot
	private double FCursorIncrement;     // Distance added when the active controlpoint is moved withe the arrow keys

	
	private void FSetCursorIncrement(double val) {
		FCursorIncrement = val;
	}
	private void FSetCurvatureScale(double Val) {
		FCurvatureScale = Val;
	}
	private void FSetShowButtocks(boolean Val) {
		FShowButtocks =Val;
	}
	private void FSetShowControlNet(boolean Val) {
		FShowControlNet = Val;
	}
	private void FSetShowCurvature(boolean Val) {
		FShowCurvature = Val;
	}
	private void FSetShowDiagonals(boolean Val) {
		FShowDiagonals = Val;
	}
	private void FSetShowFlowlines(boolean Val) {
		FShowFlowlines = Val;
	}
	private void FSetShowGrid(boolean Val) {
		FShowGrid = Val;
	}
	private void FSetModelView(TFreeModelView Val) {
		FModelView = Val;
	}
	private void FSetShowInteriorEdges(boolean Val) {
		FShowInteriorEdges = Val;
	}
	private void FSetShowMarkers(boolean Val) {
		FShowMarkers = Val;
	}
	private void FSetShowNormals(boolean Val) {
		FShowNormals = Val;
	}
	private void FSetShowStations(boolean Val) {
		FShowStations = Val;
	}
	private void FSetShowWaterlines(boolean Val) {
		FShowWaterlines = Val;
	}
	private void FSetShowControlCurves(boolean Val) {
		FShowControlCurves = Val;
	}
	private void FSetShowHydrostaticData(boolean Val) {
		FShowHydrostaticData = Val;
	}
	
	
	public TFreeVisibility(TFreeShip Owner) {
		FOwner = Owner;
	}
	public void Clear() {
	}
	public void DecreaseCurvatureScale() {
	}
	public void IncreaseCurvatureScale() {
	}
	public void LoadBinary(TFreeFileBuffer Source) {
		int I=0;
	
		Clear();
		Source.Load(I);
		FModelView = TFreeModelView.values()[I];
		Source.Load(FShowControlNet);
		Source.Load(FShowInteriorEdges);
		Source.Load(FShowStations);
		Source.Load(FShowButtocks);
		Source.Load(FShowWaterlines);
		Source.Load(FShowNormals);
		Source.Load(FShowGrid);
		Source.Load(FShowDiagonals);
		Source.Load(FShowMarkers);
		Source.Load(FShowCurvature);
		Source.Load(FCurvatureScale);
		if (FOwner.FileVersion().compareTo(TFreeFileVersion.fv195)>=0)
		{
	      Source.Load(FShowControlCurves);
	      if (FOwner.FileVersion().compareTo(TFreeFileVersion.fv210)>=0)
	      {
	         Source.Load(FCursorIncrement);
	         if (Math.abs(FCursorIncrement) < 1e-5)
	        	 FCursorIncrement=0.1;
	         if (FOwner.OnChangeCursorIncrement() != null)
	        	 FOwner.OnChangeCursorIncrement(new TNotifyEvent(this));
	         if (FOwner.FileVersion().compareTo(TFreeFileVersion.fv220)>=0)
	         {
	        	 Source.Load(FShowHydrostaticData);
	        	 Source.Load(FShowHydrostDisplacement);
	        	 Source.Load(FShowHydrostLateralArea);
	        	 Source.Load(FShowHydrostSectionalAreas);
	        	 Source.Load(FShowHydrostMetacentricHeight);
	        	 Source.Load(FShowHydrostLCF);
	        	 if (FOwner.FileVersion().compareTo(TFreeFileVersion.fv250)>=0)
	        	 {
	        		 Source.Load(FShowFlowlines);
	        	 }
	         }
	      }
		}
	}
	public void SaveBinary(TFreeFileBuffer Destination) {
	}
	
	
	public TFreeShip Owner() { return FOwner; }
	public void Owner(TFreeShip val) { FOwner = val; }
	public double CursorIncrement() { return FCursorIncrement; }
	public void CursorIncrement(double val) { FSetCursorIncrement(val); }
	public double CurvatureScale() { return FCurvatureScale; }
	public void CurvatureScale(double val) { FSetCurvatureScale(val); }
	public TFreeModelView ModelView() { return FModelView; }
	public void ModelView(TFreeModelView val) { FSetModelView(val); }
	public boolean ShowButtocks() { return FShowButtocks; }
	public void ShowButtocks(boolean val) { FSetShowButtocks(val); }
	public boolean ShowControlCurves() { return FShowControlCurves; }
	public void ShowControlCurves(boolean val) { FSetShowControlCurves(val); }
	public boolean ShowControlNet() { return FShowControlNet; }
	public void ShowControlNet(boolean val) { FSetShowControlNet(val); }
	public boolean ShowCurvature() { return FShowCurvature; }
	public void ShowCurvature(boolean val) { FSetShowCurvature(val); }
	public boolean ShowDiagonals() { return FShowDiagonals; }
	public void ShowDiagonals(boolean val) { FSetShowDiagonals(val); }
	public boolean ShowFlowlines() { return FShowFlowlines; }
	public void ShowFlowlines(boolean val) { FSetShowFlowlines(val); }
	public boolean ShowGrid() { return FShowGrid; }
	public void ShowGrid(boolean val) { FSetShowGrid(val); }
	public boolean ShowHydrostaticData() { return FShowHydrostaticData; }
	public void ShowHydrostaticData(boolean val) { FSetShowHydrostaticData(val); }
	public boolean ShowInteriorEdges() { return FShowInteriorEdges; }
	public void ShowInteriorEdges(boolean val) { FSetShowInteriorEdges(val); }
	public boolean ShowMarkers() { return FShowMarkers; }
	public void ShowMarkers(boolean val) { FSetShowMarkers(val); }
	public boolean ShowNormals() { return FShowNormals; }
	public void ShowNormals(boolean val) { FSetShowNormals(val); }
	public boolean ShowStations() { return FShowStations; }
	public void ShowStations(boolean val) { FSetShowStations(val); }
	public boolean ShowWaterlines() { return FShowWaterlines; }
	public void ShowWaterlines(boolean val) { FSetShowWaterlines(val); }
}
